package com.fluidops.datacatalog.reltables.schemascore;

import java.util.Set;

import com.fluidops.datacatalog.reltables.acsDB.ACSDB;

public class SchemaAVGScore implements ISchemaScore{

	private ConsistencyScore cs;

	public SchemaAVGScore(ACSDB acsDB) {
		this.cs = new ConsistencyScore(acsDB);
	}

	@Override
	public double compareSchemas(Set<String> schema1, Set<String> schema2) {
		double consistency = 0d;
		
		if(schema2.size() > 0){
			for(String a : schema2){
				consistency += this.cs.consistencyScore(schema1, a);
				consistency = consistency / schema2.size();
			}
		}
		return consistency;
	}

	@Override
	public ConsistencyScore getConsistencyScore() {
		return this.cs;
	}

}
